#pragma once
#include <iostream>
#include <string.h>
#include <qstring.h>
#include <qjsonobject.h>
#include <qjsonarray.h>
using namespace std;
const int N = 1e2+5;		// 队伍数
const int teamRank= 1e2 + 5;
class item
{
	public:
		item(QString name);
		item();
		~item();
		QString getName ();
		void setName(QString name);
		int* getVal();
		void setVal(int index, int val);
		int* getRank();
		void setRank(int index, int rank);
		void swapVal(int m,int n);
		virtual QJsonObject toJsonObject ();
	private:
		QString name;
		int val[N];
		int rank[teamRank];		//rank[i]代表该项目队伍i-1的排名
};

class boyItem :public item{
	public:
		static int cnt;
		boyItem(QString name) :item(name) {
			cnt++;
		}
		int getType() const {
			return type;
		}
		~boyItem() {
			cnt--;
		}
		QJsonObject toJsonObject ();
	private:
		static int type;
};



class girlItem :public item {
public:
	static int cnt;
	girlItem(QString name) :item(name) {
		cnt++;
	}
	int getType() {
		return type;
	}
	~girlItem() {
		cnt--;
	}
	QJsonObject toJsonObject ();
private:
	static int type;
};
